#include "SList.h"

void SListTest01()
{
	/*SLNode* node1 = (SLNode*)malloc(sizeof(SLNode));
	node1->data = 1;
	SLNode* node2 = (SLNode*)malloc(sizeof(SLNode));
	node2->data = 2;
	SLNode* node3 = (SLNode*)malloc(sizeof(SLNode));
	node3->data = 3;
	SLNode* node4 = (SLNode*)malloc(sizeof(SLNode));
	node4->data = 4;
	SLNode* node5 = (SLNode*)malloc(sizeof(SLNode));
	node5->data = 5;

	node1->next = node2;
	node2->next = node3;
	node3->next = node4;
	node4->next = node5;
	node5->next = NULL;

	SLNode* plist = node1;
	SLPrintf(plist);*/
}

void SListTest02()
{
	SLNode* plist = NULL;
	/*SLPushFront(&plist, 1);
	SLPushFront(&plist, 2);
	SLPushFront(&plist, 3);
	SLPushFront(&plist, 4);*/
	SLPushBack(&plist, 1);
	SLPushBack(&plist, 2);
	SLPushBack(&plist, 3);
	SLPushBack(&plist, 4);
	/*SLPrintf(plist);
	SLPopBack(&plist);
	SLPopBack(&plist);
	SLPopBack(&plist);
	SLPopBack(&plist);
	SLPrintf(plist);*/
	SLNode* f = SLFind(&plist, 2);
	if (f != NULL)
	{
		printf("ҵ!!!\n");
	}
	else
		printf("ûҵ!!!\n");


}

void SListTest03()
{
	SLNode* plist = NULL;
	SLPushBack(&plist, 1);
	SLPushBack(&plist, 2);
	SLPushBack(&plist, 3);
	SLPushBack(&plist, 4);
	SLNode* f = SLFind(&plist, 1);
	if (f != NULL)
	{
		//SLInsert(&plist, f, 100);
		SLErase(&plist, f);
	}
	SLPrintf(plist);
	SLDestroy(&plist);
	SLPrintf(plist);
}

int main()
{
	SListTest03();
	return 0;
}
